﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo
{
    class SumUtils
    {
        public int Sum(int a, int b) {
            return a + b;//两个整数相加
        }
        public double Sum(double a ,double b)
        {
            return a + b;//两个小数相加
        }
        public string Sum(string a,string b)
        {
            return a + b;//两个字符串相加
        }
        public int Sum(int a)
        {
            int sum = 0;
            for (int i = 0; i <a; i++)
            {
                sum += i;
            }
            return sum;//从1到指定整数和的方法
        }
    }
}
